﻿using System;
using System.Drawing;
using System.Collections.Generic;


namespace LockScreen
{
    public class MultipleScreenManager
    {
        private static MultipleScreenManager instance;
        private static Object _lock = new Object();

        private IList<CountDownForm> ScreenList { get; set; }

        private MultipleScreenManager()
        {
            ScreenList = new List<CountDownForm>();
        }

        public static MultipleScreenManager GetInstance()
        {
            if (instance == null)
            {
                lock (_lock)
                {
                    if (instance == null)
                    {
                        instance = new MultipleScreenManager();
                    }
                }
            }
            return instance;
        }

        public void AddScreen(Int32 x, Int32 y, Int32 width, Int32 height)
        {
            CountDownForm cdf = new CountDownForm();
            cdf.Show();
            ScreenList.Add(cdf);
            cdf.SetSize(width, height);
            cdf.SetLoaction(x, y);
        }

        public void SetPicture(Image image)
        {
            foreach (CountDownForm cdf in ScreenList)
            {
                cdf.SetPicture(image);
            }
        }

    }
}
